Add skip layer normalization#3865
Closed
TedThemistokleous wants to merge 15 commits intoadd_attention_contrib_opfrom
Closed
Add skip layer normalization#3865TedThemistokleous wants to merge 15 commits intoadd_attention_contrib_opfrom
TedThemistokleous wants to merge 15 commits intoadd_attention_contrib_opfrom
Conversation
added 6 commits
March 7, 2025 00:41
needs work on input dimensions
…dLayerNormalization with added beta input
94f3908 to
9709f30
Compare
added 3 commits
March 7, 2025 01:38
…t to reflect this Required that both mean and variance outputs are float type and not converted. This works as epsilon as well as this attribute is always float as well. Removes a bunch of extra converts when this operator is reduce precision (Float16/bf,etc)
beta and bias were flipped. Sorted this out and updated parser. captured testing beta path in parser test
Needs to have values checked. Currently working out data. Just grabbed the skip_simplied_layernorm portion and reused this while modying tests to add in beta and bias values We should be performing the following operation to verify data via numpy https://pytorch.org/docs/stable/generated/torch.nn.LayerNorm.html
994ce5d to
b90c76b
Compare
Collaborator
Author
|
Moved to 3917 to get that into develop by @ahsan-ca |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Needed to support customer models. Seen in optimized versions of BERT or optimizations using the Onnxruntime toolset
Currently built off the add_attention_contrib_op branch as this is used to parse in an optimized bert model
official Doc here: https://github.com/microsoft/onnxruntime/blob/main/docs/ContribOperators.md#com.microsoft.SkipLayerNormalization
Other useful descriptions (this vs say simplified case)
https://pytorch.org/docs/stable/generated/torch.nn.RMSNorm.html#torch.nn.RMSNorm (also known as simplified)
https://sh-tsang.medium.com/review-layer-normalization-ln-6c2ae88bae47